$(function () {
    //首屏幻灯片初始化
    $('#carousel1').carousel();

    $("body").on('click','#carousel1 .carousel-inner>div',function () {
        var _this = $(this);
        var type = _this.data('type');
        var url = '';
        if(type == 1 || type == 3){//专题页面
            url = _this.data('url');
        }else if(type==2 || type == 5 || type == 6 ){//课程详情
            url = baseloaction + '/web/course/courseInfo?courseId='+_this.data('course');
        }else if(type == 4){//直播详情
            url = baseloaction + '/web/course/liveInfo?courseId='+_this.data('course');
        }else if (type == 0){
            return;
        }

        var page = _this.data('page');// 是否打开新页面，1否，2是
        if(page==2){
            window.open(url,'_blank');
        }else{
            window.location.href = url;
        }
    });
});
